﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.CustomerOrder
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("customer_order_history", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class customer_order_history : Entity<customer_order_history>,Icustomer_order_history
    {
        #region 属性
 
        private String _order_no;

        /// <summary>FLAGS=KMI--^FORMAT=Uppercase^DATATYPE=String^PROMPT=Order No^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("Order No")]
        [Description("FLAGS=KMI--^FORMAT=Uppercase^DATATYPE=String^PROMPT=Order No^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 12)]
        [BindColumn(1, "order_no",  null, "varchar(12)", 0, 0, false)]

        public virtual String order_no

        {
            get { return _order_no; }
            set { if (OnPropertyChanging(__.order_no, value)) { _order_no = value; OnPropertyChanged(__.order_no); } }
        }

 
        private Decimal? _history_id;

        /// <summary>FLAGS=KMI--^FORMAT=Decimal(4,0)^DATATYPE=Number^PROMPT=History Id^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("History Id")]
        [Description("FLAGS=KMI--^FORMAT=Decimal(4,0)^DATATYPE=Number^PROMPT=History Id^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 4)]
        [BindColumn(2, "history_id",  null, "decimal(4,0)", 4, 0, false)]

        public virtual Decimal? history_id

        {
            get { return _history_id; }
            set { if (OnPropertyChanging(__.history_id, value)) { _history_id = value; OnPropertyChanged(__.history_id); } }
        }

 
        private String _message_text;

        /// <summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=Message Text^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("Message Text")]
        [Description("FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=Message Text^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn(3, "message_text",  null, "varchar(2000)", 0, 0, false)]

        public virtual String message_text

        {
            get { return _message_text; }
            set { if (OnPropertyChanging(__.message_text, value)) { _message_text = value; OnPropertyChanged(__.message_text); } }
        }

 
        private String _user_id;

        /// <summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=User Id^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("User Id")]
        [Description("FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=User Id^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 40)]
        [BindColumn(4, "user_id",  null, "varchar(40)", 0, 0, false)]

        public virtual String user_id

        {
            get { return _user_id; }
            set { if (OnPropertyChanging(__.user_id, value)) { _user_id = value; OnPropertyChanged(__.user_id); } }
        }

 
        private DateTime? _created_time;

        /// <summary>FLAGS=A-IU-^FORMAT=Datetime^DATATYPE=Date^PROMPT=Created Time^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("Created Time")]
        [Description("FLAGS=A-IU-^FORMAT=Datetime^DATATYPE=Date^PROMPT=Created Time^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn(5, "created_time",  null, "datetime", 0, 0, false)]

        public virtual DateTime? created_time

        {
            get { return _created_time; }
            set { if (OnPropertyChanging(__.created_time, value)) { _created_time = value; OnPropertyChanged(__.created_time); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(6, "objid",  null, "varchar(50)", 0, 0, false)]

        public virtual String objid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }

 
        private String _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(7, "objversion",  null, "varchar(24)", 0, 0, false)]

        public virtual String objversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.order_no : return _order_no;
                    case __.history_id : return _history_id;
                    case __.message_text : return _message_text;
                    case __.user_id : return _user_id;
                    case __.created_time : return _created_time;
                    case __.objid : return _objid;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.order_no : 
                        if(value != null)
                            _order_no = Convert.ToString(value);
                        else
                            _order_no = null;
                    break;
                    case __.history_id : 
                        if(value != null)
                            _history_id = Convert.ToDecimal(value);
                        else
                            _history_id = null;
                    break;
                    case __.message_text : 
                        if(value != null)
                            _message_text = Convert.ToString(value);
                        else
                            _message_text = null;
                    break;
                    case __.user_id : 
                        if(value != null)
                            _user_id = Convert.ToString(value);
                        else
                            _user_id = null;
                    break;
                    case __.created_time : 
                        if(value != null)
                            _created_time = Convert.ToDateTime(value);
                        else
                            _created_time = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToString(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMI--^FORMAT=Uppercase^DATATYPE=String^PROMPT=Order No^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field order_no = FindByName(__.order_no);

            ///<summary>FLAGS=KMI--^FORMAT=Decimal(4,0)^DATATYPE=Number^PROMPT=History Id^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field history_id = FindByName(__.history_id);

            ///<summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=Message Text^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field message_text = FindByName(__.message_text);

            ///<summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=User Id^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field user_id = FindByName(__.user_id);

            ///<summary>FLAGS=A-IU-^FORMAT=Datetime^DATATYPE=Date^PROMPT=Created Time^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field created_time = FindByName(__.created_time);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMI--^FORMAT=Uppercase^DATATYPE=String^PROMPT=Order No^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String order_no = "order_no";

            ///<summary>FLAGS=KMI--^FORMAT=Decimal(4,0)^DATATYPE=Number^PROMPT=History Id^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String history_id = "history_id";

            ///<summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=Message Text^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String message_text = "message_text";

            ///<summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=User Id^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String user_id = "user_id";

            ///<summary>FLAGS=A-IU-^FORMAT=Datetime^DATATYPE=Date^PROMPT=Created Time^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String created_time = "created_time";

            ///<summary></summary>
            public const String objid = "objid";

            ///<summary></summary>
            public const String objversion = "objversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Icustomer_order_history
    {
       #region 属性
        /// <summary>FLAGS=KMI--^FORMAT=Uppercase^DATATYPE=String^PROMPT=Order No^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String order_no { get; set; }


        /// <summary>FLAGS=KMI--^FORMAT=Decimal(4,0)^DATATYPE=Number^PROMPT=History Id^LENGTH=12^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        Decimal? history_id { get; set; }


        /// <summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=Message Text^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String message_text { get; set; }


        /// <summary>FLAGS=A-IU-^FORMAT=Unformatted^DATATYPE=String^PROMPT=User Id^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String user_id { get; set; }


        /// <summary>FLAGS=A-IU-^FORMAT=Datetime^DATATYPE=Date^PROMPT=Created Time^LENGTH=40^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        DateTime? created_time { get; set; }


        /// <summary></summary>

        String objid { get; set; }


        /// <summary></summary>

        String objversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}